/**首页图片轮播*/
var imgWidth =0;
var innerGroup = 0;
var _index = 0;
$(function(){
	 imgWidth = $(".banner>.inner>.innerwraper img:first-child").eq(0).width();
	 innerGroup = $(".banner>.inner>.innerwraper");
});

function go() {
	_index++;
	selectPic(_index);
}

function selectPic(num) {
	$(".banner>.inner").animate({
		left: -num * imgWidth,
	}, 1000, function() {
		//检查是否到最后一张
		if (_index == innerGroup.length-1) {
			_index = 0;
			$(".banner>.inner").css("left", "0px");
		}
	})
}

setInterval(go, 3000);

/**
 * 新闻评论
 */
function newsComment(){
	$.post(
		'expose/news/newsComment',
		{'newsId':$('#newsId').val()},
		function(data){
			if(data && data.success){
				showAlertDiv(data.message);
			}else if(data.code == 102){
				showDiv(data.message);
			}else{
				showAlertDiv(data.message);
			}
		},'json'
	);
}


